﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GetServerInfo.aspx.cs" 
    Inherits="ServBus.ListForm2010.AdministrationPages.GetServerInfo,$SharePoint.Project.AssemblyFullName$" 
    MasterPageFile="~/_admin/admin.master" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register TagPrefix="ServBus" Namespace="ServBus.ListForm2010.Controls" Assembly="ServBus.ListForm2010, Version=1.0.0.0, Culture=neutral, PublicKeyToken=df5827f77359eb0a" %>
<asp:Content ContentPlaceHolderID="PlaceHolderTitleBreadcrumb" runat="server">
    <ServBus:BreadCrumbNav runat="server" ID="bcNav" IsCentralAdmin="true" />
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <asp:Literal runat="server" Text="<%$SBIBLF2010Resources:ServBus.ListForm2010.Common.Resources|AdminPages,Server_Info_Title %>"></asp:Literal>
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    <asp:Literal runat="server" Text="<%$SBIBLF2010Resources:ServBus.ListForm2010.Common.Resources|AdminPages,Server_Info_Title %>"></asp:Literal>
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderPageDescription" runat="server">
    <asp:Literal runat="server" Text="<%$SBIBLF2010Resources:ServBus.ListForm2010.Common.Resources|AdminPages,Server_Info_Desc %>"></asp:Literal>
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <script type="text/javascript">
        function initSelectAll() {
            var inputs = document.getElementsByTagName('input');
            for (var i = 0; i < inputs.length; i++) {
                if (inputs[i].type == 'checkbox') {
                    inputs[i].onclick = switchSelectAll;
                    return;
                }
            }
        }
        function switchSelectAll() {
            var inputs = document.getElementsByTagName('input');
            var firstIdx = -1;
            for (var i = 0; i < inputs.length; i++) {
                if (inputs[i].type == 'checkbox') {
                    if (firstIdx == -1) firstIdx = i;
                    else inputs[i].checked = inputs[firstIdx].checked;
                }
            }
        }
        function exportServerInfo() {
            var inputs = document.getElementsByTagName('input');
            var selectValues = [];
            var idx = -1;
            for (var i = 0; i < inputs.length; i++) {
                if (inputs[i].type == 'checkbox') {
                    idx++;
                    if (idx > 0 && inputs[i].checked) selectValues.push(_serverIds[idx]);
                }
            }
            var url = 'DownloadInfo.aspx?type=srv&ids=' + selectValues.join(';');
            window.open(url);
        }
        var _serverIds;
        _spBodyOnLoadFunctionNames.push("initSelectAll()");
    </script>
    <asp:Literal runat="server" ID="ltScript"></asp:Literal>
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <table border='0' width='100%' cellpadding='0' cellspacing='0'>
        <wssuc:InputFormSection runat="server"
            Title="<%$SBIBLF2010Resources:ServBus.ListForm2010.Common.Resources|AdminPages,Server_SectionTitle %>"
            Description="<%$SBIBLF2010Resources:ServBus.ListForm2010.Common.Resources|AdminPages,Server_SectionDesc %>">
            <Template_InputFormControls>
                <tr><td>
                    <asp:CheckBoxList runat="server" ID="cblServers" CssClass="ms-vb2"></asp:CheckBoxList>
                </td></tr>
            </Template_InputFormControls>
        </wssuc:InputFormSection>
	    <wssuc:ButtonSection runat="server" ShowStandardCancelButton="false">
		    <Template_Buttons>
		        <asp:Button runat="server" CssClass="ms-ButtonHeightWidth" ID="btnExport"
		            Text="<%$SBIBLF2010Resources:ServBus.ListForm2010.Common.Resources|AdminPages,Server_Btn_Export %>"
		            OnClientClick="exportServerInfo();window.location='License.aspx';return false;" />
		        <asp:Button runat="server" CssClass="ms-ButtonHeightWidth"
		            Text="<%$SBIBLF2010Resources:ServBus.ListForm2010.Common.Resources|AdminPages,Server_Btn_Close %>"
		            OnClientClick="window.location='License.aspx';return false;" />
		    </Template_Buttons>
	    </wssuc:ButtonSection>
    </table>
</asp:Content>
